<?php
echo "Student list:<br>";
include('Student.php');
$students = array();

$first = new Student("Doe", "John","Freshman");
$first->add_email('home', 'john@doe.com');
$first->add_email('work', 'jdoe@mcdonalds.com');
$first->add_grade(65);
$first->add_grade(75);
$first->add_grade(55);
$students['j123'] = $first;

$second = new Student("Einstein", "Albert","Junior");
$second->add_email('home', 'albert@braniacs.com');
$second->add_email('work1', 'a_einstein@bcit.ca');
$second->add_email('work2', 'albert@physics.mit.edu');
$second->add_grade(95);
$second->add_grade(80);
$second->add_grade(50);
$students['a456'] = $second;

$three = new Student("Zhang", "Yuguo","Senior");
$three->add_email('home', 'Yuguo@doe.com');
$three->add_email('work', 'Yuguo@dongguan.com');
$three->add_grade(66);
$three->add_grade(77);
$three->add_grade(88);
$students['g456'] = $three;

ksort($students); 
foreach ($students as $student){
echo $student->toString() ."<br>";
}
?>